<!DOCTYPE html>
<html>

    <head>
      <meta charset="utf-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <meta name="renderer" content="webkit">
        <meta http-equiv="Cache-Control" content="no-siteapp" />
        <title>云巢活动管理平台</title>
        <meta name="keywords" content="">
        <meta name="description" content="">
        <link type="image/x-icon" rel="shortcut icon" href="images/favicon.ico" />
        <!--[if lt IE 9]>
    <meta http-equiv="refresh" content="0;ie.html"/>
    <![endif]-->
        <script>
            if(window.parent !== window) {
                window.parent.location.reload(true);
            };
        </script>
        <link href="css/bootstrap.min.css?v=3.3.6" rel="stylesheet">
        <link href="css/animate.min.css" rel="stylesheet">
        <link rel="stylesheet" href="lib/codemirror.css">
        <script src="js/jquery.min.js"></script>
        <script src="js/bootstrap.min.js"></script>
        <script src="lib/codemirror.js"></script>
        <script src="mode/clike/clike.js"></script>
        <script type="text/javascript" src="js/requirejs/require.js"></script>
        <script type="text/javascript" src="js/require-config.js"></script>
        <style type="text/css">
           .menu-wrap {
                height: 100%;
                width: 235px;
                padding-bottom: 30px;
                float: left;
                background: #424252;
            }
            .menu-head{
                border-bottom: 1px solid #000;
                box-shadow: 1px 0 0 #eee;
            }
            .left-item{
              padding-bottom: 20px;
            }
            .left-item .title{
                font-size: 14px;
                color:#888;
                font-weight: 600;
                padding: 0 10px ; 
                background: #383846;
                margin: 0 0 20px;
                height:40px;
                line-height: 40px; 
            }
            .itemDetail{
                padding: 10px;
            }
            .itemDetail label{
               display: block;
               color: #eee;
               font-size: 12px;
            }
            .itemDetail .btn-group{
                width: 100%
            }
            .itemDetail .item-dowm{
                background: #353541;
                color: #eee;
                border: 1px solid #353541;
                height: 24px;
                line-height: 24px;
                padding: 0;
                width: 100%;
                display: block;
            }
            .itemDetail .dropdown-menu{
              width: 100%;
            }

            .content-wrap {
                width: 100%;
                padding-left: 235px;
                height: 100%;
                background: #fff;
            }
            .content-wrap .CodeMirror {
              height: 100%;

            }
            .content-wrap .contentHead {
               text-align: right;
               padding: 10px 0;

            }
            .btn-head{
              padding: 4px 20px;
              margin-right: 10px;
            }
            .content-wrap .contentCon{
                border-bottom: 1px solid #e9e9e9;
                border-top: 1px solid #e9e9e9;

            }
        </style>
    </head>

    <body>
        <div id="wrapper" class="container-fluid">
            <div class="menu-wrap">
                <div class="menu-head">
                    <img class="logo" src="images/logo.jpg">
                    
                </div>
                <div class="left-content">
                    
                    <div class="left-item">
                        <h2 class="title" title="选择活动"> 选择活动</h2>
                        <div class="itemDetail">
                            <label for="">发布状态</label>
                            <div class="btn-group">
                              <button type="button" class="btn btn-default dropdown-toggle item-dowm" data-toggle="dropdown">
                                未选择 <span class="caret"></span>
                              </button>
                              <ul class="dropdown-menu" role="menu">
                                <li><a href="#">已发布</a></li>
                                <li><a href="#">未发布</a></li>
                                
                              </ul>
                            </div>
                        </div>
                        <div class="itemDetail">
                            <label for="">活动标题</label>
                            <div class="btn-group">
                              <button type="button" class="btn btn-default dropdown-toggle item-dowm" data-toggle="dropdown">
                                心情差 <span class="caret"></span>
                              </button>
                              <ul class="dropdown-menu" role="menu">
                                <li><a href="#">Action</a></li>
                                <li><a href="#">Another action</a></li>
                                <li><a href="#">Something else here</a></li>
                                <li class="divider"></li>
                                <li><a href="#">Separated link</a></li>
                              </ul>
                            </div>
                        </div>
                    </div>
                    
                    
                </div>
                
            </div>
            <div class="content-wrap">
                <div class="contentHead">
                    <a onclick="saveContent();" class="btn btn-default btn-head" title="保存">保存</a>
                    <a  class="btn btn-default  btn-head" title="调试" data-toggle="modal" data-target="#debug">调试</a>
                </div>
                <div class="contentCon">
                  <form>
                  <textarea id="editor" name="editor" >
                    package nestcloud;
                    import java.io.IOException;
                    import java.net.URLEncoder;
                    import java.sql.Connection;
                    import java.util.List;
                    import org.apache.poi.ss.usermodel.Row;
                    import utils.ConnectionUtil;//封装的能够获取到的数据链接提供类
                    import utils.ExcelUtil; //操作 Excel的工具类
                    import utils.HttpClientUtils;//封装了HttpClient的get 和post方法
                    /** web模板中所提供的jar包
                     * commons-codec-1.5.jar
                     * commons-httpclient-3.1.jar
                     * commons-lang3-3.1.jar
                     * commons-logging-1.1.3.jar
                     * dom4j-1.6.1.jar
                     * httpclient-4.3.1.jar
                     * httpcore-4.3.jar
                     * jackson-annotations-2.2.3.jar
                     * jackson-core-2.2.3.jar
                     * jackson-databind-2.2.3.jar
                     * jackson-module-jaxb-annotations-2.2.3.jar
                     * poi-3.9.jar
                     * poi-ooxml-3.9.jar
                     * poi-ooxml-schemas-3.9.jar
                     * stax-api-1.0.1.jar
                     * xml-apis-1.0.b2.jar
                     * xmlbeans-2.3.0.jar
                     * 
                     */
                    /**
                     * 
                     * 
                    * @class         : Nestcloud（类名）
                    * @Package       : utils
                    * @company       : 无限极
                    * @create        : 2016年12月30日 上午9:20:14 （创建日期 时间）
                    * @description   : 模板
                    * @version       : v2.0（版本）
                     */
                    public class Nestcloud {
                        /**
                         */
                        public Connection getConnection(){
                            return ConnectionUtil.getConnection();
                            dskdlasl
                        }
                    }

                  </textarea>
                </form>
                </div>
                
                <!-- 调试 -->
                <div class="modal fade" id="debug" data-toggle="modal">
                    <div class="modal-dialog">
                        <div class="modal-content">
                            <div class="modal-header course-feedback-title">
                                <!-- Split button -->
                                <form class="form-inline" role="form">
                                  <div class="btn-group">
                                    <button type="button" class="btn btn-primary">POST</button>
                                    <button type="button" class="btn btn-primary dropdown-toggle" data-toggle="dropdown">
                                      <span class="caret"></span>
                                      <span class="sr-only">Toggle Dropdown</span>
                                    </button>
                                    <ul class="dropdown-menu" role="menu">
                                      <li><a href="#">POST</a></li>
                                      <li><a href="#">GET</a></li>
                                    </ul>
                                  </div>
                                  <div class="form-group" >
                                    <label class="sr-only" for="webaddr">web address</label>
                                    <input type="text" class="form-control" id="webaddr" placeholder="web address" value="http：//localhost/nestcloud/admin/activity">
                                  </div>
                                  <div class="form-group" style="width:150px;">
                                    <label class="sr-only" for="editCode">editCode</label>
                                    <input type="text" class="form-control" id="editCode" placeholder="editCode" value="editCode" style="width:150px;">
                                  </div>
                                  <a type="button" class="btn btn-default" title="参数">参数</a>
                                  <a type="button" class="btn btn-primary" title="运行">运行</a>
                                </form>
                            </div>
                            <div class="modal-body course-feedback-body">
                                <img src="images/u9358.png" alt="" width="100%">
                            </div>
                        </div>
                    </div>
                </div>

            </div>
        </div>
        

        <script type="text/javascript">
            require([
              "lib/codemirror", "mode/clike/clike","addon/hint/show-hint.js",
            ], function(CodeMirror) {
              var editor = CodeMirror.fromTextArea(document.getElementById("editor"), {
                lineNumbers: true,
                lineWrapping:true,
                mode: "clike",
                extraKeys: {"Ctrl": "autocomplete"},
                mode: "text/x-scala"
              });
              // 获取编辑器里面内容
              // var setValue = editor.setValue(function(){
              //   $.ajax({
              //       type:'post',
              //       url:"/admin/activity/code",
              //       dataType:'json',
              //       data:{id:id},
              //       success:function(data){
              //           if(data.success){
              //               console.log('更新成功');
              //           }
              //       },
              //       error:function(err){
                        
              //       }
              //   })
              // })

              // var getRange = 
              // console.log(getRange);
              // editor.setOption("readOnly",function(){

              //   editor.getRange({line:1,ch:0},{line:18,ch:0});
              // });
              // editor.getCursor({line:1,ch:1});


              // var lineCount = editor.lineCount();
              // var setSelection = editor.setSelection({line:1,ch:0},{line:18,ch:0});
              // console.log(setSelection);

            });
            

        </script>
    </body>